package com.zyh;

import com.zyh.dao.IUserDao;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class App {
    public static void main(String[] args) {
        // 1. 初始化IOC容器
        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
        // 获取bean，参数就是在配置文件中配置的bean的id
        IUserDao userDao = (IUserDao) context.getBean("userDao");
        userDao.save("zhang", "123");
    }
}
